import Vue from 'vue'
import axios from './router/axios'
import VueAxios from 'vue-axios'
import App from './App'
import router from './router/router'
import './permission' // 权限
import './error' // 日志
import './cache'// 页面缓存
import store from './store'
import * as urls from '@/config/env'
// import Element from 'element-ui'
import i18n from './lang' // Internationalization
import './styles/common.scss'
// import basicBlock from './components/basic-block/main'
import basicContainer from './components/basicContainer/Index'
import website from '@/config/website'
import './static/global.css' // 公共样式
// import YituModule from 'yitu-module-general/dist/yituModule.umd.min.js'
import Pagination from './components/base/Pagination'
import SearchCondition from './components/base/SearchCondition'
import YituTable from './components/base/YituTable'
import TopRightOperation from './components/common/TopRightOperation'
// 图标字体库
import '../public/cdn/iconfont/normal/index'
// import '@/util/encrypt/index'
import 'babel-polyfill'
import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer)
// Vue.use(YituModule, { rootAxios: axios })
var Element = Element || window.ELEMENT

Vue.use(router)
Vue.use(VueAxios, axios)
Vue.use(Element, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(window.AVUE, {
  i18n: (key, value) => i18n.t(key, value)
})

// element中message只提示一个
import './assets/js/message' // 引入重写的message

// 注册全局容器

Vue.component('Pagination', Pagination)// 分页
Vue.component('BasicContainer', basicContainer)
Vue.component('SearchCondition', SearchCondition)
Vue.component('YituTable', YituTable)
Vue.component('TopRightOperation', TopRightOperation)
// Vue.component('BasicBlock', basicBlock)
// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key]
})
// 加载website
Vue.prototype.website = website

Vue.config.productionTip = false
new Vue({
  router,
  store,
  i18n,
  render: h => h(App)
}).$mount('#app')
